package by.demchenko.sample.dataaccess.base;

import by.demchenko.sample.datamodel.Course;
import by.demchenko.sample.datamodel.Person;
import by.demchenko.sample.datamodel.Result;
import by.demchenko.sample.datamodel.Schedule;

import javax.persistence.metamodel.SingularAttribute;
import javax.transaction.Transactional;
import java.util.List;

public interface ResultDao extends AbstractDao<Integer, Result> {

    Result getResult(Person student, Course course);

    List<Result> getAllResults();

    List<Result> getResults(SingularAttribute<Result, ?> attr, boolean ascending, int startRecord, int pageSize);

    boolean canAssignTheGrade(Person student, Course course);

    List<Result> getResultsByStudent(Person student);

    int getCount();

    List<Result> getResultsByCourse(Schedule schedule);

    @Transactional
    void createTable(Schedule scheduleRecord);
}